#!/usr/bin/env bash

echo "PRAGMA foreign_keys = 1; INSERT INTO domains (id, name, type) VALUES (9999, 'test', 'Master');" |  sqlite3 ../regression-tests/pdns.sqlite3 2>&1
echo "PRAGMA foreign_keys = 1; INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (9999, 'test', 'test', 0, 'test', 'Test 123');" | sqlite3 ../regression-tests/pdns.sqlite3 2>&1
echo "PRAGMA foreign_keys = 1; DELETE FROM domains WHERE id = 9999;" |  sqlite3 ../regression-tests/pdns.sqlite3 2>&1
echo "PRAGMA foreign_keys = 1; SELECT * FROM comments WHERE domain_id = 9999;" |  sqlite3 ../regression-tests/pdns.sqlite3 2>&1

exit 0
